package controllers.caterinaController.controllers;

import java.util.ArrayList;

import contract.EmployeeContract;
import controllers.dbWrapper.EmployeeWrapper;

import person.Employee;

public class EmployeeManager {

	public static ArrayList<Employee> getEmployeeList() throws Exception{
		return EmployeeWrapper.getAllEmployees(true);
	}

	public static void firesEmployee(EmployeeContract employeeCont) throws Exception {
		if (!employeeCont.getPerson().getTaxCode().equals("ADM0"))
			EmployeeWrapper.deleteEmployee(true, employeeCont);
		else throw new Exception("SYS_ADMIN_FIRES");
	}
}
